home *** CD-ROM | disk | FTP | other *** search
/ Audio 4.94 - Over 11,000 Files / audio-11000.iso / mac / soundutl / rvrb52cp.hqx / Reverb v5.2 folder / Reverb programs / Monitor < prev    next >
Encoding:
Text File  |  1993-10-06  |  529 b   |  21 lines

  1. //
  2. // Monitor input with gain control. Defaults to -6 dB gain.
  3. // The equal power balance control attenuates everything by 3 dB.
  4. //
  5. // MIDI ctl 1 -> gain from -20 dB to 0 dB
  6. // MIDI ctl 2 -> equal power balance
  7. //
  8. // Bill Gardner, October, 1993
  9. //
  10. #include "macros.rvb"
  11.  
  12. #define db_to_gain(db) pow(10,db/20)
  13. #define gain db_to_gain(init(-6,range(ctl(1),-20,0)))
  14. #define balance init(0.5, ctl(2))
  15. #define PI 3.141593
  16.  
  17. move(Lin,Lout);
  18. mul(Lout,gain * cos(balance * PI / 2));
  19. move(Rin,Rout);
  20. mul(Rout,gain * sin(balance * PI / 2));
  21.